<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<f:view locale="#{salaoMB.internacionalizacao.currentLocale}">
	<h:head>
		<meta http-equiv="Content-Type"
			content="text/html; charset=ISO-8859-1" />
		<title>Novo Serviço</title>
	</h:head>
	<h:body>
		<table width="100%">
			<tr>
				<td><ui:include src="/index.xhtml" />
				</td>
			</tr>
		</table>
		<h:form id="novoServico">
		
		<p:ajaxStatus onstart="status.show();" oncomplete="status.hide();" />
		<p:dialog widgetVar="status" modal="true" closable="false"
			header="Status" draggable="false">
			<p:graphicImage value="../img/ajaxloadingbar.gif" />
			<h:outputText value="Aguarde..." />
		</p:dialog>
		
		<p:contextMenu> 
	 		<p:menuitem value="Menu Principal" url="/index.faces" icon="ui-icon-extlink"/>
		</p:contextMenu>
			 
		<p:growl id="messages" showDetail="true" sticky="true" />
				
			<table width="40%" align="center">
				<tr>
					<td>
						<table align="center">
							<tr>
								<td style="font-size: 15px;font-family: Arial; font-weight: bold;">Etapa 3 de 5</td>
								<td>&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td><p:panel header="#{msg.novoServico}">
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td>
										<h:outputText id="textEstabelecimento" value="Estabelecimento: " />
									</td>
									<td colspan="4">
										<h:selectOneMenu value="#{servicosMB.idSelectedEstabelecimento}" rendered="true" id="estabelecimento" immediate="true">
										<f:selectItem itemLabel="Selecione..." itemValue="0"/>
										<f:selectItems
													value="#{servicosMB.mapEstabelecimento}"
													var="estabelecimento"
													itemLabel="#{estabelecimento.nomeFantasia}"
													itemValue="{estabelecimento.id}" />
										</h:selectOneMenu>
									</td>
								</tr>
								<tr>
									<td><h:outputText value="#{msg.nomeServico}: " /></td>
									<td colspan="4"><p:inputText value="#{servicosMB.servicos.descricao}" maxlength="20" size="30" title="#{msg.descNomeServico}" /></td>
								</tr>
								<tr>
									<td><h:outputText value="Preço: " /></td>
									<td colspan="4">
									<p:spinner id="spinnerPreco"
												value="#{servicosMB.servicos.preco}" min="0" size="7"
												title="Valor do serviço oferecido" stepFactor="0.5" />
									</td>
								</tr>
								<tr>
									<td><h:outputText value="Tempo de duração: " /></td>
									<td>
										<p:spinner id="spinnerDuracaoHora"
														value="#{servicosMB.horas}" min="00" max="10" size="7"
														title="Tempo em minutos para concluir o serviço"
														stepFactor="1" />
									</td>		
									<td align="left">		
										<h:outputText value="h"/> 
									</td>										
									<td>											
										<p:spinner id="spinnerDuracaoMinutos"
											value="#{servicosMB.minutos}" min="00" max="59" size="7"
											title="Tempo em minutos para concluir o serviço"
											stepFactor="05" /> 				
									</td>
									<td>	
										<h:outputText value="min" /> 
									</td>
								</tr>
								<tr>
									<td>
										<p:commandButton type="reset" value="#{msg.limpar}" />
									</td>
									<td colspan="4">
										<p:commandButton type="submit" actionListener="#{servicosMB.incluir}" value="#{msg.gravar}" update="messages,novoServico"/>
									</td>
								</tr>
								<tr>
									<td colspan="5">
											<h:message for="msgInclusaoServico" id="msgInclusaoServico" />
									</td>
								</tr>
							</table>
						</p:panel>
					</td>
				</tr>
			</table>
		</h:form>
	</h:body>
</f:view>
</html>